<include file="Public/header"/>
<body style="background:#f5f5f5;">

<include file="Public/menu"/>

<div id="tbh5v0">
<!--------筛选 form 表单 开始-------------->
<form action="{:U('Mobile/order_list/ajax_order_list')}" name="filter_form" id="filter_form">  
      <div class="Evaluation2">
            <ul>
              <li><a href="{:U('/Mobile/User/order_list')}" class="tab_head <if condition="$_GET[type] eq ''">on</if>"  >全部</a></li>
              <li><a href="{:U('/Mobile/User/order_list',array('type'=>'WAITPAY'))}"      class="tab_head <if condition="$_GET[type] eq 'WAITPAY'">on</if>">待付款</a></li>

              <!--<li><a href="{:U('/Mobile/User/order_list',array('type'=>'WAITCCOMMENT'))}" class="tab_head <if condition="$_GET[type] eq 'WAITCCOMMENT'">on</if>">已完成</a></li>-->
            </ul>
      </div>     
      
	<div class="order ajax_return">
    
    <if condition="empty($lists)">
        <section id="cart-content">
      <div class="qb_tac" style="padding:50px 0">
        <img src="__STATIC__/images/flow/empty_cart.png" width="170" >
        <br>暂无消费记录信息</div>
      <div class="qb_gap" style="width:60%; margin:0 auto;">
        <a href="{:U('Goods/categoryList')}" class="mod_btn btn_strong"><i class="icon iconfont icon-paobu fontbao"></i>去商城逛逛</a>
      </div>
</section>
        </if>
	   <volist name="lists" id="list">
       <div class="order_list">
          <h2>
              <span style="width:100%;">订单号:{$list.order_sn} <if condition="$list[pay_status] eq 1"><em style="  color:#2cd83d; ">已支付</em><else/><em style="  color:#2cd83d; ">待支付</em></if><if condition="$list.type_id eq 2"><em style="float:right; color:#2cd83d; ">时长订单</em></if></span>
          </h2>


           <if condition="$list.type_id neq 2">
               <volist name="list.goods_list" id="good">
                   <dl style="position: relative">
                       <!-- <dt><img src="{$good.goods_id|goods_thum_images=200,200}"></dt> -->
                       <dt><img src="{$good.original_img}"></dt>
                       <dd class="name"><strong>{$good.goods_name}</strong>
                           <span style="position: absolute;">{$good.spec_key_name} </span></dd>
                       <dd class="pice">￥{$good['member_goods_price']}<em>x{$good['goods_num']}</em></dd>
                   </dl>
               </volist>
               <else/>
               <div style="width:95%; margin: 0 auto;">
                   <div style="border-bottom: 1px solid #dedede; padding: 3px 5px;"><b style="color:#2cd83d;font-weight: normal;">进入时间：</b>{$list.start_time|date='Y-m-d H:i:s',###}</div>
                   <div style="border-bottom: 1px solid #dedede;padding: 3px 5px;"><b style="color:#2cd83d;font-weight: normal;">出去时间：</b><if condition="$list.end_time eq 0">消费中<else/>{$list.end_time|date='Y-m-d H:i:s',###}</if></div>
               </div>

           </if>

          	
          <div class="pic">
              <if condition="$list.type_id neq 2">
              共{$list.goods_list|count}件商品
              </if>
              <span>&nbsp;&nbsp;合计：</span><strong>￥{$list['order_amount']}</strong></div>
          <div class="anniu" style="width:95%">

                <!--<if condition="$list.cancel_btn eq 1 and $list.type_id neq 2"><span onClick="cancel_order({$list.order_id})">取消订单</span></if>-->
                <if condition="$list.cancel_btn eq 1 and $list.type_id neq 2"><span onClick="cancel_order({$list.order_id})">取消订单</span></if>

                <if condition="$list.pay_btn eq 1 and $list.order_amount gt 0  "><a href="{:U('Mobile/Cart/cart4',array('order_id'=>$list['order_id']))}">立即付款</a></if>
          </div>
       </div>
		</volist>  
    </div>
  <!--查询条件-->
  <input type="hidden" name="type" value="<?php echo $_GET['type'];?>" />
</form>   
<notempty name="lists"> 
   <div id="getmore" >
  		<a href="javascript:void(0)" onClick="ajax_sourch_submit()">点击加载更多</a>
  </div>         
</notempty>    
</div>


<script language="javascript">
var  page = 1;
 
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_submit()
 {	 	
 		page += 1; 	 
		$.ajax({
			type : "GET",
			url:"/index.php?m=Mobile&c=User&a=order_list&type={$_GET['type']}&is_ajax=1&p="+page,//+tab,			
//			url:"{:U('Mobile/User/order_list',array('type'=>$_GET['type']),'')}/is_ajax/1/p/"+page,//+tab,			
			//data : $('#filter_form').serialize(),
			success: function(data)
			{
				if(data == '')
					$('#getmore').hide();
				else  
				{
					$(".ajax_return").append(data);			
					$(".m_loading").hide();
				}
			}
		}); 
 }
 
//取消订单
function cancel_order(id){
	if(!confirm("确定取消订单?"))
		return false;
	location.href = "/index.php?m=Mobile&c=User&a=cancel_order&id="+id;
}

</script>
<include file="Public/footer_nav"/>
</body>
</html>